<template>
	<view class="container">
		<image src="/static/order/pay-success.png" class="pay-success"></image>
		<view class="title">支付成功</view>
		<button v-if="fromType=='app'" open-type="launchApp" class="btn-sure">返回APP</button>
		<button v-else class="btn-sure" @click="goBackPage">确定</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				fromType: ''
			}
		},
		onLoad({
			fromType = 'order'
		}) {
			this.fromType = fromType
		},
		methods: {
			goBackPage() {
				if (this.fromType == 'order') {
					uni.switchTab({
						url: '/pages/shop/index'
					})
				} else if (this.fromType == 'recharge') {
					uni.switchTab({
						url: '/pages/home/index'
					})
				}
			}
		}
	}
</script>

<style>
	page {
		background-color: #F4F7F7;
	}
</style>
<style lang="scss" scoped>
	.container {
		padding: 0 44rpx;
	}

	.pay-success {
		width: 320rpx;
		height: 320rpx;
		display: block;
		margin: 0 auto;
		padding-top: 200rpx;
	}

	.title {
		font-weight: 400;
		font-size: 28rpx;
		color: #333333;
		text-align: center;
		margin-top: 20rpx;
	}

	.btn-sure {
		height: 70rpx;
		background: #FFC046;
		border-radius: 35rpx;
		font-weight: 400;
		font-size: 28rpx;
		color: #FFFFFF;
		margin-top: 98rpx;
	}
</style>